<div class="row" ng-controller="person_uploadOneUsedBook">

    <div class="col-md-9">

        <div class="row" ng-if="bookInfo">
            <div class=col-md-6>
                <ol class="breadcrumb">
                    <li><a ui-sref="book.one-book({isbn13:bookInfo.attributes.isbn13})"
                           ng-bind="bookInfo.attributes.title"></a></li>
                    <li class="active" ng-bind="title"></li>
                </ol>
            </div>
            <div class="col-md-6">
                <div class="btn-toolbar pull-right">
                </div>
            </div>
        </div>

        <!-- 没有isbn就来了-->
        <div class="row" ng-if="!usedBookJson.isbn13">
            <div class="col-md-12">
                <h3 class="text-danger">先搜索到你想上传的那本书，然后点击右上角的上传</h3>
                <hr>
            </div>
            <!-- 搜索表单-->
            <form class="col-md-6">
                <div class="form-group form-group-lg">
                    <div class="input-group input-group-lg">
                        <input autofocus type="search" class="form-control" placeholder="搜索 书名、作者、ISBN"
                               ng-model="SearchBook$.keyword"
                               ng-change="SearchBook$.searchInputOnChange()">
                        <span class="input-group-addon" ng-if="SearchBook$.isLoading">加载中...</span>
                    </div>
                </div>
            </form>
        </div>

        <bs-one-book-info-detail ng-if="bookInfo" book-info="bookInfo"></bs-one-book-info-detail>

    </div>

    <aside class="col-md-3">

        <div class="row" ng-if="bookInfo">
            <div class="col-md-12">
                <h4><span ng-bind="title"></span> <span ng-bind="bookInfo.attributes.title"></span></h4>
                <hr>
            </div>
            <form class="col-md-12">
                <div class="form-group" ng-if="usedBookJson.role!='circle'">
                    <input autofocus type="number" class="form-control" ng-model="usedBookJson.price"
                           placeholder="输入要价(数字,人民币元)">
                </div>
                <div class="form-group">
                    <textarea type="text" class="form-control" placeholder="对这本书你还有什么想说的吗?"
                              ng-model="usedBookJson.des"
                              popover-placement="left"
                              popover-template="'commonUsedBookDesWords.html'"></textarea>
                </div>
                <button class="btn btn-primary btn-block"
                        ng-disabled="!(!isLoading && usedBookJson.isbn13)"
                        ng-click="submitOnClick('sell')">提交
                </button>
            </form>
            <div class="col-md-12">
                <small ng-if="usedBookJson.role==='sell'" style="font-size: x-small">上传要卖的旧书:把你不要的旧书低价卖给正需要它的同学</small>
                <small ng-if="usedBookJson.role==='need'" style="font-size: x-small">发布求书公告:把你正需要的书公告给社区帮你找到它</small>
                <small ng-if="usedBookJson.role==='circle'" style="font-size: x-small">分享书漂流:免费把你的书传递给下一位读者</small>
            </div>
            <script type="text/ng-template" id="commonUsedBookDesWords.html">
                <h4>常用描述内容</h4>
                <button class="btn btn-default btn-sm"
                        style="margin: 5px"
                        ng-disabled="isLoading"
                        ng-repeat="word in InfoService$.commonUsedBookDesWords"
                        ng-click="usedBookJson.des=usedBookJson.des+' '+word"
                        ng-bind="word"></button>
            </script>
        </div>

    </aside>
</div>
